local qingyi = fk.CreateSkill({
  name = "pc__qingyi", 
})


qingyi:addEffect("active", {
  anim_type = "offensive",
  card_num = 0,
  prompt = "令两名角色各重铸一张手牌",
  target_num = 2,
  can_use = function(self, player)
    return player:usedSkillTimes(qingyi.name, Player.HistoryPhase) == 0
  end,
  card_filter = Util.FalseFunc,
  target_filter = function(self, player, to_select, selected)
    return #selected < 2 and not to_select:isKongcheng()
  end,
  on_use = function(self, room, effect)
    local player = effect.from
    local target1 = effect.tos[1]
    local target2 = effect.tos[2]
    local card1= room:askToChooseCards(target1, {
        target = target1,
        min = 1,
        max = 1,
        flag = "h",
        skill_name = qingyi.name,
        prompt = "重铸一张手牌",
    })
    local card2= room:askToChooseCards(target2, {
        target = target2,
        min = 1,
        max = 1,
        flag = "h",
        skill_name = qingyi.name,
        prompt = "重铸一张手牌",
    })
    local card1_c = Fk:getCardById(card1[1]).color
    local card2_c = Fk:getCardById(card2[1]).color
    room:recastCard(card1, target1, qingyi.name)
    room:recastCard(card2, target2, qingyi.name)
    if card1_c == card2_c then
      local use = room:askToUseVirtualCard(player, {
        name = "ex_nihilo",
        skill_name = qingyi.name,
        prompt = "视为使用一张【无中生有】",
        cancelable = true,
        extra_data = {
          bypass_times = true,
          extraUse = true,
        },
        card_filter = {
          n = 0,
        },
      })
    else
      local use = room:askToUseVirtualCard(player, {
        name = "fire_attack",
        skill_name = qingyi.name,
        prompt = "视为使用一张【火攻】",
        cancelable = true,
        extra_data = {
          bypass_times = true,
          extraUse = true,
        },
        card_filter = {
          n = 0,
        },
      })
    end
  end,
})

Fk:loadTranslationTable {
["pc__qingyi"] = "清议",
[":pc__qingyi"] = "出牌阶段限一次，你可以令两名角色各重铸一张手牌。若这些牌颜色均相同/不同，你可以视为使用一张【无中生有】/【火攻】。",
["$pc__qingyi1"] = "布政得失，愿与诸君共议。",
["$pc__qingyi2"] = "领军伐谋，还请诸位献策。",
}
return qingyi